 Listen Help Index

Overview

Basic Operation

RS232 Communications

Configuration Options

Monitoring Serial Communications

Browse Operations

Menu Commands

Setup/Preferences

Data Link Monitor

Browse Menu Options

Toolbar Options

Statusline

ASCII Table

How To ...

Connect

Search For

Specify Byte Strings

Copy & Print

Use Checksum Calculator

Use Filters

Use Traps/Triggers


Listen: Basic Operation

Listen...Basic Operation

The Listen Application is designed to utilize the standard Windows COM drivers to monitor RS232 Communications occurring between two separate devices.  It operates by tapping into the RS-232 transmit signals via the Receive lines of two local serial ports.  In effect, each transmit signal is connected to two receive ports: the original communicating device as well as the Listening device.  As long as reasonable distances are maintained, there should be no degradation of performance between the original communications devices by having two passive receivers connected.  The Transmit signal from the Listening device is not connected, and the original RS-232 handshake lines may remain in place.  As Listen receives data on an active port, it is displayed to the screen, maintaining the timing characteristics of the communications protocol.

Listen operates in basically two modes. The first is an active monitoring session whereby characters are displayed to the screen as they occur.  Listen maintains captured data in a circular buffer of configurable size.  During a monitoring session, the capture buffer will always contain the last series of characters received, with new data overwriting old data.  Listen also supports a separate Trap Buffer which may be configured to save data based on a Trigger condition.

The Browse mode of operation allows the user to examine both the capture buffer and the trap buffer.  Menu selections are available which allow either buffer to be saved to a disk file.  During Browse, several additional functions are provided to assist in troubleshooting a communications link.  Portions of the display screen may be selected for printing or copied to the Windows Clipboard.  The user may perform a search operation to locate a given byte string within the displayed buffer.  The Browse mode also provides a Checksum Calculator which allows several widely used checksum algorithms to be applied to a selected block of data.


RS232 Communications Overview

RS-232 Communications Overview

The RS-232 standard allows communications to occur between two devices using only three basic conductors, (Transmit, Receive, & Ground).  The active transmit signal from each device is connected to the passive receive input for the corresponding device.  The RS-232 transmit signal allows multiplexing to two passive receivers without degrading performance.  This feature allows the Listen application to tap into and monitor the communications.  If two serial ports are available on the Listening device, both sides of the conversation may be monitored.

RS-232 control signals such as CTS/RTS, (Clear to Send/Request to Send). are used to control communications data flow between devices.  Communications systems using these control signals generally involve half-duplex software protocols whereby only one device transmits at a time.  The Listen application will display data in the sequence received, maintaining the timing characteristics of the original protocol.  All RS-232 control lines remain in the original position and are unaffected by connection of the Listening device.

Without handshaking lines connected to the Listening device, there is no way for the monitoring application to control the flow of data.  The ability of the Listening device to monitor and capture asynchronous data depends entirely upon the volume of the data being transmitted and the speed of the PC executing the Listen application.  The Listen application has been proven effective monitoring a 19.2 KBaud full-burst, (half-duplex software), communications system utilizing a 90Mhz Pentium Processor as the monitoring device.


RS232 Serial Connections

RS-232 Serial Connections

RS232 Communications devices are classified as DTE or DCE, (Data Terminal Equipment or Data Communications Equipment).  The standard pin-out arrangement allows a straight 25-pin cable to be attached between an DCE device and a DTE device.  If a DCE device is attached to another DCE device, (or DTE to DTE), the cabling conductors must be switched such that the proper active pins are connected to the proper passive pins on the corresponding device, (i.e. Transmit to Receive, Request to Send to Clear to Send, etc.).

The three primary RS-232 signals are generally located on pins 2,3 & 7 of a twenty-five pin D connector.  Pin 7 is ground; 2&3 are either Transmit & Receive or Receive & Transmit, depending on the configuration of DCE/DTE.  On 9-pin connectors 2,3 & 5 are used, with 5 being ground.

The connection to the Listening device consists of two serial connectors, each with two conductors, (Receive & Ground for port 1, and Receive and ground for port 2).  The two receive lines may be connected to either end of an RS-232 cable segment on pins 2&3.  Both Grounds may be connected to pin 7.  In this configuration, Listen can monitor data from device A on port 1, and data from device B on port 2.


Overview...Configuration Options

Listen may monitor data from any of the four standard PC COM ports.  The physical characteristics of each port, (baudrate, parity, etc.) is configurable, as well as the specific ports to enable during a monitoring session.  To best utilize the characteristics of individual PC Displays,  Listen allows configuration of the colors and character fonts used to display data received from each port.

The default implementation of Listen uses the standard Windows character set to display data in ASCII format.  Printable characters are displayed as their ASCII equivalent, control characters are displayed as bracketed mnemonics, and all other characters are displayed as a bracketed decimal value.  For example, a typical display segment may appear as:

[SOH]01[STX]ABCDEF[ETX][237][EOT]

This example represents 13 bytes of data enumerated as the following decimal values:

 01,48,49,02,65,66,67,68,69,70,03,237,04

The choice of bracketing characters used for non-printable data is selectable via a simple menu selection.  Any two characters may be selected for this purpose.  Normally matching character sets, ( [ ],{ },( ),<>), would be selected, however this is not a requirement.  To preserve the integrity of the display and avoid unnecessary confusion, the bracketing characters will be displayed as a bracketed numeric value if contained in the body of the data being displayed.  For example, in the default configuration, square brackets, ([ ]), would be displayed as [901] & [093].

The user also has control over the selection of the numeric base to be used for non-printing characters.  Listen defaults to decimal, however menu selections allow this to be changed to Octal, Hexadecimal or Binary.

As an added feature, Listen allows the representation of any data byte to be overloaded with a custom generated display.  The user may select a character string of up to ten characters to be substituted for any given data byte.


Monitoring Operation

The primary function of Listen is to monitor serial communications traffic occurring on an RS-232 serial data link.  Each active port connected to Listen is monitored for incoming data and displayed to the screen as it appears.  Data received from each COM port is displayed in a different color to easily differentiate between character segments.  Non-printing characters are displayed as a bracketed numeric value, (or user defined string segment).  Menu options allow each port to be activated or deactivated to start and stop character display.  The screen can be frozen, by entering the Browse mode of operation.

Listen maintains a capture buffer to maintain all characters received during a monitoring session.  The size of the capture buffer may be configured between 1 and 32K bytes.  There are actually two buffers, since the originating port identification is maintained for each data byte.  Therefore 64K bytes of memory would be required to configure a 32K buffer.  The capture buffer is maintained using circular indexing techniques such that the last x number of data bytes received are always available for display.

Listen may also be configured with a separate buffer used to trap data based on a configurable trigger.  This trap buffer is of fixed size, (configurable up to 16384 bytes), and represents a snapshot of the capture buffer at the time the trigger occurred.  The trap buffer may be configured to save data prior to, after, or surrounding the trigger.


Browse Operation

The Browse mode of operation allows the user to examine the contents of the capture and/or trap buffer.  Data collection is suspended while Browse is active.  Menu options allow the user to save the existing capture buffer to a disk file, or read a previously saved file into memory.

The vertical scroll bar provides convenient access to any portion of the buffer display.  Listen is designed to maintain the integrity of a data byte display.  It will not split the character representation of a data byte at the end of a line.  Therefore, if the display contains non-printing characters, (or customized character representations) every line will not necessarily end on an even boundary.  Listen will attempt to maintain display line integrity during scrolling operations, however, due to different pixel widths necessary to display different data bytes, a slight shift may occur when scrolling up.

In addition to scrolling through the data buffers, a Search/Find operation may be initiated through a dropdown menu selection.  The user may specify a search string consisting of various data bytes and/or bit patterns representing wildcard or dont care bits.  Listen will attempt to locate the defined data by searching forward or backward in the displayed buffer as directed by the dialog.

Various portions of the buffer may be selected for printing or copied to the Windows clipboard by highlighting the display using the mouse and clicking on a menu or toolbar item.  Selected data blocks may also be input to the checksum calculator for a quick check of data validity.


ASCII Table Display

The ASCII table display, activated from the Menu View selection, displays the Ascii character codes for each data byte.  Data is displayed in Decimal, Octal, Hex and Binary notation.  This display also allows the user to change the representation Listen uses for a given byte code.  The default operation of Listen displays printable characters as their Ascii equivalent.  Control characters and non-printing characters are represented by bracketed values, (text or numeric).  The user may customize the character display by double-clicking on the desired code and specifying a new string of characters inside the pop-up dialog.


Toolbar Buttons

Listen ToolBar buttons provide convenient access to menu options.  These include the following, (Left to Right):

Open Disk File	Restore Capture buffer from disk file.
Save Buffer	Save Capture buffer to Disk File.
Start Monitoring Session	Enter Monitoring mode of operation.
Stop Monitoring Session	Enter Browse mode of operation.
Copy Data to Clipboard	Copy marked block of data to Windows clipboard.
Print Data	Print marked block of data to default printer.


Status Line

The Listen Status line displays the activation state of Filters, and Triggers, and the condition of the Trap Buffer.   The status line also displays each active serial port and its associated baud rate.


Overview...Traps & Triggers

In addition to the capture buffer, Listen contains an additional data buffer used to Trap data based on the condition of a logic Trigger.  The Trigger is a configurable event which, when it occurs, may indicate a communications problem.  When activated, the Trigger causes data in the Capture Buffer to be transferred to the Trap Buffer along with a TimeStamp.  Data collection continues after the Trigger and the Trap may be activated again if the condition reappears.

The Trap Buffer represents a subset of the Capture Buffer at the time the Trigger becomes active.  The Trap may be configured to represent x bytes prior to the Trigger and/or x bytes after the trigger.  The size of the Trap Buffer, as well as the normal Capture Buffer, are configurable via Listen.ini file selections.

The Trigger is specified as a string of data bytes originating from a given COM port.  Bit patterns may be specified which include dont care designations for certain data bits: (see Specifying Byte Strings).  As with block filter operation, Triggers are designed to operate with block oriented, half-duplex communications protocols.  A transition of data direction, (i.e. each time data is received from a different port), will reset the trigger comparison buffer.


Overview...Filters

Filters consist of two varieties, Byte Filters and Block Filters.  Byte filters consist of a bit pattern specified for each of the four serial ports.  Each bit in the patter is configured as either one, zero, or dont care.  If enabled, each data byte received from a port must match the filter specification to be included in the capture buffer and subsequent display.  Data bytes which do not match the filter specification are ignored.

Block filters are designed to operate in block oriented half-duplex software protocols whereby exchanges of information are synchronized between sender and receiver.  A data block is identified as data transmitted uninterrupted from one device to another.  The response data transmitted in return constitutes a data link transition.  Block filters operate by comparing a byte string to the beginning of each data block.  Data blocks which match the filter criteria are included in the Listen capture buffer.  Data blocks which do not match the filter specification are ignored.  A transition resets the comparison buffers for each block filter.

Byte filters are always applied in front of block filters which are always applied in front of the Trigger.


Checksum Calculator

To assist in trouble-shooting a communications protocol, Listen provides a built-in calculator for some well known checksum calculations.  Additional calculations may be added from time to time in new releases of the software.

To use the calculator, simply mark an area of the display by clicking the left mouse button and dragging it across the display.  Selecting the appropriate checksum type from the menu will generate a dialog box representing the results of the calculation.  Listen will represent a status check box if the calculated data stream spans data received from more than one COM port.


Copy & Print Block Operations

Data displayed on the screen may be selected for print or copy functions by marking an area on the screen and selecting the appropriate menu option.  Marking a data area consists of pointing the cursor at the start of the area to be marked, pressing the left mouse button, and dragging the cursor to the end of the desired block.  The marked data area is displayed in the color specified for TEXT MARKER in the color configuration dialog.  Once a selected area is marked, the menu options should activate, allowing selection of the Print or Copy functions.

Marked data areas are printed using the default printer font and the selected display colors.  The resolution of the printer page is used to format the marked data and will not necessarily match the format of the display.  Display colors can be temporarily adjusted to achieve appropriate results using a black & white printer.

Marked data areas may be copied to the Windows clipboard in an ASCII format, with each line representing data obtained from an individual COM port.  For example, a typical clipboard copy may look as follows:

Port 1: [CR][LF]

Port 2: ASDFGHIJKL[CR][LF]

Port 1: qwerty[CR][LF]

Port 2: QWERTY[CR][LF]

Marked data areas may also be used as input to a checksum calculator or to a search dialog.


Overview...Search/Find

The Search/Find menu option allows the user to input a string of data bytes and Listen will attempt to locate a match within the existing Display Buffer.  The search string may include non-printing characters as well as dont care bit specification for some bytes.  After locating a match, Listen will advance the display buffer to the appropriate location and display the string in the designated TEXTMARKER color.


Specifying Byte Strings

Byte strings are specified to define searches, block filters, and triggers.  Byte strings consist of a sequence of data bytes any of which may include bits designated as dont care.  The dialog boxes which support byte strings present a simple edit control for entering data.  Data may be entered in the same format as displayed to the screen.  Character data may be entered as the ASCII equivalent codes with each character representing a single data byte.  Control characters and non-printing characters may be specified using the bracketed notation and numeric base as configured.  Bit patterns may be specified by entering the bracketed binary byte representation with x specified for the dont care bits.

Controls which support byte strings contain a parser which is activated upon exiting the dialog box.  If errors are discovered by the parser, the dialog box will remain open and a message box displayed which provides details concerning the error.

Byte data may also be entered in the representation as defined by custom character strings for a particular application.  If the default numeric base is Octal or Hex, an x may be specified by a single digit.


Save & Restore Operations

Save and Open File selections are available from the Browse menu.  The Save function copies the current capture buffer to a specified disk file.  The Restore function copies a disk file into the capture buffer.  The configured buffer size is contained in the file format, and a warning message is generated if the user attempts to read a file with more characters than will fit in the current buffer.  In this case, bytes at the end of the file will be truncated.


Menu...Configuration and Preferences
Menu...Configuration & Preferences

The following configuration options are available for the Listen application to control the physical connection, display characteristics, filtering operation, and the trigger condition used to initiate the trap buffer:

HARDWARE
Serial Port Configuration	Baud Rate, Parity, etc.
DISPLAY
Color Selection	Tailors the colors used to display data associated with a given COM port.
Font Selection	Configures the font used for each COM port.
Non-Printing Characters	Specifies preferences for numeric base and bracketing character set used for non-printing characters.
Custom Data Representation	Allows customization of the display for printing & non-printing characters.
FILTERS/TRAPS
Byte Filters	Allows specification of bit masks to be used in filtering incoming data bytes.
Block Filters	Allows specification of byte strings to be used in filtering communications blocks in half-duplex software protocols.
Traps & Triggers	Allows specification of a byte string to trigger collection of data to trap buffer.


Data Monitor Menu Options

During an active monitoring session, the Files Menu changes operation to provide quick and easy access to the selection status of each of the four COM ports.  Ports may be enabled or disabled by simply clicking on the appropriate menu item during a monitoring session.


Browse Menu Options

During Browse operation, menu selections are made available for examining the content of the capture and trap buffers.  The user may scroll forward or backward though each buffer, search for byte strings, mark areas to copy or print,  and copy data to/from disk.

View Trap Buffer	Toggles display between capture and trap buffers.
Save/Restore	Allows the displayed buffer to be saved to disk.  Restores a previously saved disk file to the capture buffer.
Clear Buffer	Zeroes the capture buffer.
Copy/Print	Allows a marked block of data to be printed or copied to the Windows Clipboard.
Find	Searches the display buffer for a specified byte string.
Checksum Calculator	Initiates a checksum calculator for a designated block of data.


Menu...New/Collect

Use the New/Collect menu option to initiate a active monitoring session.  The first time a session is initiated, Listen will prompt for the COM port ids to activate.  Data bytes received will be appended to the end of the existing Capture Buffer and displayed to the screen as they occur.


Configuration & Preferences

Drop down menu selections are available to configure the operating characteristics of the COM ports and to easily change the display characteristics for non-printing character data.

The Hardware menu option provides details concerning the current settings for each of the four possible PC COM ports.  Only those ports which are currently available to the Listen application are displayed.  Those ports which are not installed, or currently accessed by another application or device driver are dimmed and inaccessible.  The baudrate, parity, number or data bits, and number of stop bits may be configured via this dialog.

Menu options available under the Preferences selection, allow specification of the character set used to bracket non-printing characters and the default numeric base, (decimal, octal, or hex).


Setup...Byte Filters
n

Setup...Byte Filters

Listen provides four byte filters, one for each possible COM port.  Byte filters are specified as a simple bit pattern, accessible via a dialog box selection for each port.

A dropdown menu selection passes control to a dialog box representing the current bit pattern and activation state for each filter.  A simple button is available for each COM port which allows the pattern to be changed.  To enable the byte filter for a particular COM port, simply click on the Enable check box next to the displayed pattern.


Setup...Block Filters

Block filters consist of a string of data bytes associated with incoming data from a given COM port.  Block filters may be up to 100 bytes long and include bytes or bit patterns designated as dont care.  Block filter comparisons are made on the first data received from a COM port after a logic transition, (i.e. data direction change).

An option accessible from the main Listen menu presents a dialog box displaying the current block filter designations for each of the four available COM ports.  A push button control allows the block filter byte string to be modified.  To activate the filter for a particular port, simply click on the Enable check box.


Menu...View Trap Buffer

During Browse operations, the user may examine either the capture buffer or the trap buffer.  A simple menu selection allows the display buffer to be switched back and forth at will.


Menu...Clear Capture Buffer

The Clear Capture Buffer simple deletes all data form the existing capture buffer and allows a new monitoring session to begin with a fresh buffer.


Setup...COM Port Configuration

The COM port configuration dialog is accessible from the Setup menu.  It presents the current configuration for each of the four available communications ports. Dialog List Box selections are available to select each ports baudrate, parity, start, and stop bits.

This information is only presented for a given port if that port is available for use by Listen.  If the data associated with a given COM port is disabled, (Grayed), it indicates that the port is either not physically installed or that it is in use by another Windows application or device driver.


Color Selection

The color selection dialog allows different colors to be assigned to data originating from each COM port.  Both the foreground and background colors may be assigned to best utilize the available display.  In addition to the four pen selections representing the four serial ports, the colors associated with the block marking functions may also be configured.


Font Selection

The display font used for data originating from each serial port may be configured from dialog boxes accessible from the Listen Setup menu.  Any font installed on the PC may be selected for any port.  If different sized fonts are selected for different ports, the largest font will be used for scaling the display vertical line selection, (i.e. Line Height).  If italic fonts are mixed with normal fonts, the resulting display may appear with inconsistent line lengths due to the offset resolution of the x position pixels relative to the top and bottom of each character..


Setup...INI File Selections

The size of the capture buffer may be specified by the BUFFERSIZE parameter in the [MEMORY] section of the Listen.ini file.  The value may be configured between 1-32 representing 1024-32767 bytes.  Actual memory required to configure the buffer is double the specified value due to the fact that each data byte is associated with a given COM port identification.

The size of the trap buffer may be specified by the TRAPBUFFERSIZE parameter up to 16K bytes.  The TRAPBUFFERPLACEMENT parameter specifies the relative position of the trigger inside the trap buffer.  (i.e. PRE specifies that the trap buffer contain data prior to the trigger, POST specifies data retention after the trigger, and MID places the trigger in the middle of the trap buffer.)